/* 
 * copy_wrap.c
 * Created on November 16, 2005; 7:40 PM
 * by vramadurai
 */
#include "HsTypes.h"
#include "iqdma_3500.h"

#define TRC(x) //(x)

void copy_wrapped_data(
                        hs_int16_t  * restrict piRdPtr,
                        hs_int16_t  * restrict piStartPtr,
                        hs_int16_t  * restrict ssIn,
                        hs_int32_t  siOffset
                    )
{
    int j;
    int i;
   
    TRC(__putstring("WRAPPED\n"));
    for(j=0; j < (22-siOffset); j++)
    {        
        ssIn[j] =  IQ_SCALE(piRdPtr[j]);     
    }
       
    for(i=0; i<siOffset; j++,i++)
    {
        ssIn[j] =  IQ_SCALE(piStartPtr[i]);      
    }
}

void copy_wrapped_data_samps(
                        hs_int16_t  * restrict piRdPtr,
                        hs_int16_t  * restrict piStartPtr,
                        hs_int16_t  * restrict ssIn,
                        hs_int32_t  siOffset,
                        hs_int32_t samps
                    )
{
    int j;
    int i;
   
    TRC(__putstring("WRAPPED\n"));
    for(j=0; j < (samps-siOffset); j++)
    {        
        ssIn[j] =  IQ_SCALE(piRdPtr[j]);     
    }
       
    for(i=0; i<siOffset; j++,i++)
    {
        ssIn[j] =  IQ_SCALE(piStartPtr[i]);      
    }
}

void copy_wrapped_data_22(
                        hs_int16_t  * restrict piRdPtr,
                        hs_int16_t  * restrict piStartPtr,
                        hs_int16_t  * restrict ssIn,
                        hs_int32_t  siOffset
                    )
{
    int j;
    int i;
   
    TRC(__putstring("WRAPPED\n"));
    
    for(j=0; j < (22-siOffset); j++)
    {        
        ssIn[j] =  IQ_SCALE(piRdPtr[j]);     
    }
       
    for(i=0; i<siOffset; j++,i++)
    {
        ssIn[j] =  IQ_SCALE(piStartPtr[i]);      
    }    
}

void copy_wrapped_data_14(
                        hs_int16_t  * restrict piRdPtr,
                        hs_int16_t  * restrict piStartPtr,
                        hs_int16_t  * restrict ssIn,
                        hs_int32_t  siOffset
                    )
{
    int j;
    int i;
   
    TRC(__putstring("WRAPPED\n"));
    for(j=0; j < (14-siOffset); j++)
    {        
        ssIn[j] =  IQ_SCALE(piRdPtr[j]);     
    }
       
    for(i=0; i<siOffset; j++,i++)
    {
        ssIn[j] =  IQ_SCALE(piStartPtr[i]);      
    }
}

void copy_wrapped_data_44(
                        hs_int16_t  * restrict piRdPtr,
                        hs_int16_t  * restrict piStartPtr,
                        hs_int16_t  * restrict ssIn,
                        hs_int32_t  siOffset
                    )
{
    int j;
    int i;
 
    TRC(__putstring("WRAPPED\n"));
    for(j=0; j < (44-siOffset); j++)
    {        
        ssIn[j] =  IQ_SCALE(piRdPtr[j]);     
    }
       
    for(i=0; i<siOffset; j++,i++)
    {
        ssIn[j] =  IQ_SCALE(piStartPtr[i]);      
    }
}

void copy_wrapped_data_16(
                        hs_int16_t  * restrict piRdPtr,
                        hs_int16_t  * restrict piStartPtr,
                        hs_int16_t  * restrict ssIn,
                        hs_int32_t  siOffset
                    )
{
    int j;
    int i;

    TRC(__putstring("WRAPPED\n"));
    for(j=0; j < (16-siOffset); j++)
    {
        ssIn[j] =  IQ_SCALE(piRdPtr[j]);      
    }
   
    for(i=0; i<(siOffset); j++,i++)
    {
        ssIn[j] =  IQ_SCALE(piStartPtr[i]);       
    }    
}

void copy_wrapped_data_32(
                        hs_int16_t  * restrict piRdPtr,
                        hs_int16_t  * restrict piStartPtr,
                        hs_int16_t  * restrict ssIn,
                        hs_int32_t  siOffset
                    )
{
    int j;
    int i;

    TRC(__putstring("WRAPPED\n"));
    for(j=0; j < (32-siOffset); j++)
    {
        ssIn[j] =  IQ_SCALE(piRdPtr[j]);      
    }
   
    for(i=0; i<(siOffset); j++,i++)
    {
        ssIn[j] =  IQ_SCALE(piStartPtr[i]);       
    }    
}

void copy_wrapped_data_88(
                        hs_int16_t  * restrict piRdPtr,
                        hs_int16_t  * restrict piStartPtr,
                        hs_int16_t  * restrict ssIn,
                        hs_int32_t  siOffset
                    )
{
    int j;
    int i;

    TRC(__putstring("WRAPPED\n"));
    for(j=0; j < (88-siOffset); j++)
    {
        ssIn[j] =  IQ_SCALE(piRdPtr[j]);      
    }
   
    for(i=0; i<(siOffset); j++,i++)
    {
        ssIn[j] =  IQ_SCALE(piStartPtr[i]);       
    }    
}
